import { useEffect, useState } from "react";
import { getChannelListAPI } from "@/apis";

function useChannelList() {
  const [channelList, setChannelsList] = useState([]);
  useEffect(() => {
    // 初始化频道列表
    const getChannel = async () => {
      const res = await getChannelListAPI();
      setChannelsList(res.data.channels);
    };
    getChannel();
  }, []);
  return { channelList };
}

export { useChannelList };
